#include <iostream>
#include <vector>
#include <type_traits>

template<typename T>
class MyClass {
public:
	typename T::type typeObj;

public:
	//void Func() {
	//	T::type* ptr;
	//}
};

struct Test1
{
	typedef int type;
};

struct Test2
{
	static int type;
};


template<typename T>
using MyVector = std::vector<T>;

template<typename T>
struct MyVector1
{
	typedef std::vector<T> type;
};

template<typename T>
class MyWidget {
	MyVector<T> myVector;
};

template<typename T>
class MyWidget1 {
	typename MyVector1<T>::type myVector1;
};

template<typename T>
class MyWidget2 {
private:
	T ri;

public:
	MyWidget2(T ri) : ri(ri) {}

public:
	void Func() {
		std::remove_reference_t<T> t = ri;
		t++;
	}

	void Func1() {
		T t = ri;
		t++;
	}
};


int main() {
	MyClass<Test1> c;

	//MyClass<Test2> c1;
	//c1.Func();


	MyWidget<int> myWidget;
	MyWidget1<int> myWidget1;


	int i = 2;
	MyWidget2<int&> myWidget2(i);
	myWidget2.Func();
	std::cout << "myWidget2.Func(), i: " << i << std::endl;
	myWidget2.Func1();
	std::cout << "myWidget2.Func1(), i: " << i << std::endl;

	return 0;
}